package com.zyh.controller;


import com.zyh.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;



/**
 * 文章控制器
 */
@Controller
public class PostContrpller {
    @Autowired
    PostService postService;

    /**
     * 写一篇文章
     * @param content
     * @return
     */
    @PostMapping("/create")
    public String create(String content){
        postService.create(content);
        return "redirect:/";
    }
}
